<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="__PUBLIC__/admin/css/lines.css" rel="stylesheet"
	type="text/css">
	<link href="__PUBLIC__/admin/js/tbox/box.css" rel="stylesheet"
		type="text/css" />
	<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
	<script type="text/javascript" src="__PUBLIC__/admin/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/admin/js/tbox/box.js"></script>
	<title>节点管理</title>
</head>

<body>
	<div class="so_main">
		<div class="page_tit">【{$lineName}】 节点管理</div>
		<div class="Toolbar_inbox">
			<a href="{:U('Admin/addNode', array('line_id'=>$line_id))}"
				class="btn_a"><span>添加节点</span></a>
		</div>

		<div class="list">
			<table width="100%" id="mytab" border="0" cellspacing="0"
				cellpadding="0">
				<thead>
					<th class="line_l">编号</th>
					<th class="line_l">名称</th>
					<th class="line_l">经度</th>
					<th class="line_l">纬度</th>
					<th class="line_l">在线路的位置</th>
					<th class="line_l">操作</th>
				</thead>
				<volist name="nodes" id="vo">
				<tr overstyle='on' id="node_{$vo['node_id']}">


					<td>{$vo.node_id}</td>
					<td>{$vo.name}</td>
					<td>{$vo.longitude}</td>
					<td>{$vo.latitude}</td>
					<td>{$vo.order_id}</td>
					<td><a
						href="{:U('Admin/editNode', array('node_id'=>$vo['node_id']))}">编辑</a>
						&nbsp <a href="javascript:void(0);"
						onclick="deleteNode({$vo['node_id']});">删除</a></td>
				</tr>
				</volist>
			</table>
		</div>
	</div>
</body>
</html>
<script>
//删除用户
function deleteNode(node_id) {
	node_id = node_id.toString();
	if(node_id == '' || !confirm('删除成功后将无法恢复，确认继续？')) 
		return false;
	
	$.post("{:U('Admin/delectNode')}", {node_id:node_id}, function(res){
		if(res == '1') {
			/*
			line_id = line_id.split(',');
			for(i = 0; i <line_id .length; i++) {
				$('#line_'+line_id[i]).remove();
			}
			*/
			$('#node_'+node_id).remove();
			ui.success('操作成功');
		}else {
			ui.error('操作失败');
		}
	});
}
</script>